<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>火柴人</title>
    <style>
        html,
        body {
            width: 100%;
            height: 100%;
        }

        * {
            padding: 0px;
            margin: 0px;
        }

        body {
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: bisque;
        }

        .P {
            position: relative;
            width: 200px;
            height: 200px;
            animation: run 7s infinite 0s ease-in;
        }

        .A {
            position: absolute;
            width: 50px;
            height: 50px;
            background-color: black;
            border-radius: 100px;
            animation: head 2s infinite 0s alternate;
        }

        .B {
            position: absolute;
            height: 60px;
            width: 0px;
            border-left: 10px solid black;
            bottom: 50px;
            top: 50px;
            left: 20px;
        }
        .C{
            position: absolute;
            border-left: 10px solid black;
            border-bottom: 10px solid black;
            width: 40px;
            height: 40px;
            transform: rotate(60deg);
            top: 50px;
            left: 20px;
            transform-origin: 0% 0% 0px;
            animation: c 1.3s infinite 1s alternate;
        }
        .D{
            position: absolute;
            border-left: 10px solid black;
            border-bottom: 10px solid black;
            width: 40px;
            height: 40px;
            transform: rotate(315deg);
            top: 55px;
            left: 20px;
            transform-origin: 0% 0% 0px;
            animation: d 1.3s infinite 0.5s alternate;
        }
        .E{
            position: absolute;
            border-top: 10px solid black;
            border-right: 10px solid black;
            width: 40px;
            height: 40px;
            transform: rotate(320deg);
            top: 100px;
            right: 123px;
            transform-origin: left top;
            animation: e 1s infinite 0s alternate;
        }
        .F{
            position: absolute;
            border-top: 10px solid black;
            border-right: 10px solid black;
            width: 40px;
            height: 40px;
            transform: rotate(130deg);
            top: 100px;
            right: 123px;
            transform-origin: left top;
            animation: f 1s infinite 1s alternate;
        }
        @keyframes head {
            0%{
                transform: rotate3d(0,0,1,5deg);
            }
            25%{
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            50%{
                transform: rotate3d(0,0,1,5deg);
            }
            75%{
                transform: rotate3d(0,0,1,-30deg) skew(15deg,0deg);
            }
            100%{
                transform: rotate3d(0,0,1,20deg) skew(-15deg,0deg);
            }
        }
        @keyframes c {
            0%{
                transform: rotate(110deg);
            }
           
            100%{
                transform: rotate(-50deg);
            }
           
        }
        @keyframes d {
            0%{
                transform: rotate(90deg);
            }
           
            100%{
                transform: rotate(-60deg);
            }
        }
        @keyframes e {
            0%{
                transform: rotate(110deg);
            }
           
            100%{
                transform: rotate(-10deg);
            }
        }   
        @keyframes f {
            0%{
                transform: rotate(110deg);
            }
           
            100%{
                transform: rotate(-10deg);
            }
        }
        @keyframes run {
            0%{
                transform: translate(-200px,0px);
            }
           
            100%{
                transform: translate(1800px,0px);
            }
        }     
    </style>
</head>

<body>
    <div class="P">
        <div class="A"></div>
        <div class="B"></div>
        <div class="C"></div>
        <div class="D"></div>
        <div class="E"></div>
        <div class="F"></div>
    </div>
</body>

</html>